package com.zzx.boot.controller;

import com.zzx.boot.servlet.UtilsService;
import com.zzx.boot.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author tan
 * @version 1.0
 * @date 2023/7/8 17:02
 */
@RestController
@RequestMapping("/utils")
@RequiredArgsConstructor
@Api(tags = "工具类")
public class UtilsController {

    private final UtilsService utilsService;

    @ApiOperation(value = "上传图片")
    @PostMapping("/upload")
    public R upload(MultipartFile file){
        return R.success(utilsService.upload(file));
    }

}
